package com.example.friendcash.database.core;

public final class Friend {

    public final long id;
    public final String name;

    public Friend(long id, String name) {
        this.id = id;
        this.name = name;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        final Friend friend = (Friend) o;
        return id == friend.id && !(name != null ? !name.equals(friend.name) : friend.name != null);

    }

    @Override
    public int hashCode() {
        int result = (int) (id ^ (id >>> 32));
        result = 31 * result + (name != null ? name.hashCode() : 0);
        return result;
    }

    @Override
    public String toString() {
        return name;
    }
}
